package com.sunrise.xdoc.entity.operator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sunrise.xdoc.entity.AbstractAuditEntity;

@Entity
@Table(name = "op_privilege_exception")
@Inheritance(strategy = InheritanceType.JOINED)
public class PrivilegeException extends AbstractAuditEntity {
	private static final long serialVersionUID = 7937551845051433241L;
	private OperatorRole role;
	private Privilege privilege;
	private String exceptionMode; // "CRUDE"

	@ManyToOne
	@JoinColumn(name = "role_id")
	@NotNull
	public OperatorRole getRole() {
		return role;
	}

	public void setRole(OperatorRole role) {
		this.role = role;
	}

	@ManyToOne
	@JoinColumn(name = "privilege_id")
	public Privilege getPrivilege() {
		return privilege;
	}

	public void setPrivilege(Privilege privilege) {
		this.privilege = privilege;
	}

	@Column(name = "exception_mode")
	public String getExceptionMode() {
		return exceptionMode;
	}

	public void setExceptionMode(String exceptionMode) {
		this.exceptionMode = exceptionMode;
	}
}
